package com.wzq.service.impl;

import com.wzq.pojo.Resume;
import com.wzq.repository.ResumeRepository;
import com.wzq.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wzq.Jolin
 * @company none
 * @create 2020-08-09 18:58
 */
@Service
public class ResumeServiceImpl  implements ResumeService {


    @Autowired
    private ResumeRepository resumeRepository;

    @Override
    public Resume findById(Long id) {
        return resumeRepository.findById(id).get();
    }

    @Override
    public List<Resume> findAllResume() {
        return resumeRepository.findAll();
    }

    @Override
    public void update(Resume resume) {
        resumeRepository.save(resume);
    }

    @Override
    public void delete(Long id) {
        resumeRepository.deleteById(id);
    }

    @Override
    public void add(Resume resume) {
        resumeRepository.save(resume);
    }
}
